package Test.Test1;

import java.util.Scanner;

public class Market_test {
    public static void main(String[] args) {
        Market p=new Market();
        p.marketName="白马商城";
        p.address="临泉路888号";
        Scanner in=new Scanner(System.in);
        Member s=null;
        while (true){
            System.out.println("增添新会员请按1");
            System.out.println("会员涨分请按2");
            System.out.println("换购商品请按3");
            System.out.println("商场信息请按4");
            System.out.println("退出请按0");
            System.out.println("请选择");
            switch (in.nextInt()){
                case 1:
                    System.out.println("请输入卡号，姓名，手机号");
                    s = new Member(in.next(), in.next(), in.next(), 0);
                    boolean b = p.addmember(s);
                    if (b == true) {
                        System.out.println("添加成功");
                    } else {
                        System.out.println("添加失败，请重新输入");
                    }
                 break;
                case 2:
                    System.out.println("请输入卡号和分数");
                    boolean c=p.inc(in.next(),in.nextInt());
                    if (c==true){
                        System.out.println("加分成功");
                    }else {
                        System.out.println("加分失败");
                    }
                    break;
                case 3:
                    System.out.println("1:100分兑换餐巾纸一包");
                    System.out.println("2:400分兑换剃须刀一把");
                    System.out.println("3:1000分兑换炒锅一个");
                    System.out.println("请输入卡号，和兑换类型");
                    String v=p.duihuan(in.next(),in.nextInt());
                    if (v==null){
                        System.out.println("兑换失败");
                    }else{
                        System.out.println(v);
                    }
                case 4:
                        p.show();
                        break;
                case 5:
                    return;
            }

        }
    }
}
